{{ .dataGrid }}
<div id="system_loglist_datagrid_toolbar" style="padding:5px;height:auto">
    <form>
        <a href="javascript:;" onclick="systemLogDelete();" class="easyui-linkbutton" iconCls="icons-other-delete">清空所有日志</a>
    </form>
</div>

<!-- 查看详细信息 -->
<div id="system_loglist_detail_dialog" class="easyui-dialog word-wrap" title="详细参数"
     data-options="modal:true,closed:true,iconCls:'icons-other-information',buttons:[{text:'关闭',iconCls:'icons-arrow-cross',handler:function(){$('#system_loglist_detail_dialog').dialog('close');}}]"
     style="width:400px;height:260px;padding:5px"></div>

<script type="text/javascript">
    var system_loglist_datagrid_id = 'system_loglist_datagrid';
    //搜索
    function systemLogSearch(that) {
        var queryParams = $('#' + system_loglist_datagrid_id).datagrid('options').queryParams;
        $.each($(that).parent('form').serializeArray(), function () {
            queryParams[this['name']] = this['value'];
        });
        $('#' + system_loglist_datagrid_id).datagrid('reload');
    }
    //删除日志
    function systemLogDelete() {
        $.post('/b/system/log-delete', {week: 4}, function (res) {
            if (res.errcode) {
                $.messager.alert('提示信息', res.errmsg, 'error');
            } else {
                $('#' + system_loglist_datagrid_id).datagrid('reload');
                $.messager.alert('提示信息', res.errmsg, 'info');
            }
        }, 'json');
    }
    //参数格式化
    function systemLogViewFormatter(val) {
        return '<a href="javascript:;" onclick="systemLogDetailDialog(this);">' + val + '</a>';
    }
    //查看详细信息
    function systemLogDetailDialog(that) {
        var id = 'system_loglist_detail_dialog';
        $('#' + id).dialog({content: $(that).html()});
        $('#' + id).dialog('open');
    }
</script>